package com.huaxindata.im.main.contactview.friend.model;

import android.text.TextUtils;

import com.huaxindata.im.constants.ContactConstants;
import com.huaxindata.im.model.contact.ContactPerson;

/**
 * 通过手机号查询到的用户信息
 */
public class UserModel{

    /**
     * msg : 存在用户
     * orgName :
     * nickName : 冇
     * sex : 0
     * lon : 114.431132
     * title :
     * userId : 438
     * imgUrl : http://www.iwatercloud.cn:8081/uploads/image/userHeadImg/20170803162021929.jpg
     * telPhone : 18802716779
     * orgCode :
     * company :
     * state : 1
     * email :
     * lat : 30.509365
     */

    private String msg;
    private String orgName;
    private String nickName;
    private int sex;
    private double lon;
    private String title;
    private int userId;
    private String imgUrl;
    private String telPhone;
    private String orgCode;
    private String company;
    private int state;//状态为1,说明该用户是企业注册用户
    private String email;
    private double lat;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public double getLon() {
        return lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getTelPhone() {
        return telPhone;
    }

    public void setTelPhone(String telPhone) {
        this.telPhone = telPhone;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public double getLat() {
        return lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public ContactPerson toPerson() {
        ContactPerson person = new ContactPerson("" + userId, nickName, imgUrl);
        person.setTitle(TextUtils.isEmpty(title) ? ContactConstants.CH_USER : title);
        person.setPhone(telPhone);
        person.setCompany(TextUtils.isEmpty(company) ? ContactConstants.CH_COMPANY : company);
//        person.latLng = new LatLng(lat, lon);
        return person;
    }
}
